#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<pthread.h>
#include<string.h>

void *rout(void*arg)
{
    int i;
    for(;;)
    {
        printf("我是进程1\n");
        printf("%ld\n",pthread_self());
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    int ret;
    if((ret=pthread_create(&tid,NULL,rout,NULL))!=0)
    {
        fprintf(stderr,"pthread_create : %s\n",strerror(ret));
        exit(EXIT_FAILURE);
    }

    int i;
    for(;;)
    {
        printf("我是main进程\n");
        printf("%ld\n",tid);
        
        sleep(1);
    }
    return 0;

}